Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests for particle diffusion #2209

Closed
wants to merge 17 commits into from

Conversation

jlubo
Copy link
Collaborator

@jlubo jlubo commented Aug 15, 2023

Python tests are added to ensure the working of the diffusion of arbitrary particles in setups with 1-3 segments (cf. issues #2084 and #2145).

Besides showing that the diffusion seems to work if segments have the same radius, the tests that are added here also point to the fact that the diffusion across segments of different radius is still erroneous. Therefore, I left the tests for different radii commented until #2145 has been resolved.

@thorstenhater
Copy link
Contributor

Hey @jlubo,

thanks for adding this. Could you run black . and push the results? That'll make the Linter
check pass.

@thorstenhater
Copy link
Contributor

And flake8 . :D

@jlubo
Copy link
Collaborator Author

jlubo commented Aug 16, 2023

Okay, black now passes (I had previously used an older version, seems that they changed something). Yeah, now flake8 is complaining... I'll try to fix that, too :)

Copy link
Contributor

@thorstenhater thorstenhater left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey,
made some comments for improvements, rest looks great, thanks.

.gitignore Outdated Show resolved Hide resolved
test/unit/diffusion/neuron_with_diffusion.mod Show resolved Hide resolved
python/test/readme.md Outdated Show resolved Hide resolved
python/test/readme.md Outdated Show resolved Hide resolved
python/test/unit/test_diffusion.py Show resolved Hide resolved
python/test/unit/test_diffusion.py Outdated Show resolved Hide resolved
python/test/unit/test_diffusion.py Outdated Show resolved Hide resolved
@jlubo jlubo force-pushed the tests_for_particle_diffusion branch from 74a8f99 to 2c1e802 Compare August 24, 2023 14:04
@jlubo
Copy link
Collaborator Author

jlubo commented Aug 24, 2023

Hey, made some comments for improvements, rest looks great, thanks.

Thanks @thorstenhater! I've revised the code according to the comments.

@jlubo jlubo requested a review from thorstenhater August 24, 2023 16:22
ext/fmt Outdated Show resolved Hide resolved
ext/pugixml Outdated Show resolved Hide resolved
@jlubo jlubo force-pushed the tests_for_particle_diffusion branch from 25fe938 to 7f77d60 Compare August 25, 2023 17:52
@jlubo jlubo requested a review from thorstenhater August 25, 2023 17:54
thorstenhater
thorstenhater previously approved these changes Aug 25, 2023
Copy link
Contributor

@thorstenhater thorstenhater left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you very much!

@thorstenhater
Copy link
Contributor

cscs-ci run daint-gpu

@thorstenhater
Copy link
Contributor

thorstenhater commented Aug 29, 2023

Uh-oh

subprocess.CalledProcessError: Command 'make' returned non-zero exit status 2.
 Error:
/tmp/tmpqgxm6fo0/build/generated/diffusion/neuron_with_diffusion_gpu.cu(59): warning #177-D: function "arb::diffusion_catalogue::<unnamed>::multiply" was declared but never referenced
/tmp/tmpqgxm6fo0/build/generated/diffusion/synapse_with_diffusion_gpu.cu(74): error: identifier "n_" is undefined
/tmp/tmpqgxm6fo0/build/generated/diffusion/synapse_with_diffusion_gpu.cu(55): warning #177-D: function "arb::diffusion_catalogue::<unnamed>::multiply" was declared but never referenced
1 error detected in the compilation of "/tmp/tmpqgxm6fo0/build/generated/diffusion/synapse_with_diffusion_gpu.cu".
make[2]: *** [CMakeFiles/diffusion-catalogue.dir/build.make:183: CMakeFiles/diffusion-catalogue.dir/generated/diffusion/synapse_with_diffusion_gpu.cu.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/diffusion-catalogue.dir/all] Error 2

@boeschf could you take a look? I suspect the recent changes to event delivery clash with the diffusion handling:

    if (ii_ < (end_ - begin_)) {
        const auto tid_ = (begin_ + ii_)->mech_index;
        if ((ii_ > 0) && ((begin_ + (ii_ - 1))->mech_index == tid_)) return;
        for (auto i_ = begin_ + ii_; i_ < end_; ++i_) {
            if (i_->mech_index != tid_) break;
            [[maybe_unused]] auto weight = i_->weight;
            unsigned lane_mask_ = arb::gpu::ballot(0xffffffff, tid_<n_);

this was emitted by modcc for the NET_RECV. Note the missing n_, which I assume should be
end_ - begin_ here?

@jlubo jlubo requested review from thorstenhater and boeschf October 7, 2023 19:19
@jlubo
Copy link
Collaborator Author

jlubo commented Oct 7, 2023

The different-radii and different-length tests are now uncommented. They should succeed if they are run with this new fix in the diffusion solver: thorstenhater@7577092

@thorstenhater
Copy link
Contributor

Hey @jlubo,

could you leave them disabled, I'll add them to the to-be-made PR for the fixes.

…ent_radii' again (for as long as the related fix is not merged)
@jlubo
Copy link
Collaborator Author

jlubo commented Oct 10, 2023

Done :)

@thorstenhater
Copy link
Contributor

I'll fix the GPU problem in my follow-up #2226

Copy link
Contributor

@thorstenhater thorstenhater left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! See also downstream #2226. Two questions:

  1. It seems like lots of special casing for the different setups (num_sgs=1,2,3). Do you think it would be cleaner to split these into different tests altogether?
  2. Question also inline: Can't we always compute the equilibrium concentration?

@jlubo
Copy link
Collaborator Author

jlubo commented Oct 14, 2023

1. It seems like lots of special casing for the different setups (num_sgs=1,2,3). Do you think it would be cleaner to split these into different tests altogether?

I agree, I've now split the function get_morph_and_decor() into into individual functions for 1, 2, and 3 segments.

2. Question also inline: Can't we always compute the equilibrium concentration?

Yes we can! I've introduced a more general computation of CV volumes making this possible now.

@jlubo jlubo requested a review from thorstenhater October 14, 2023 15:04
@boeschf
Copy link
Contributor

boeschf commented Oct 23, 2023

cscs-ci run daint-gpu

@thorstenhater
Copy link
Contributor

Hey @jlubo,

could I close this? It's subsumed in #2226.

@jlubo
Copy link
Collaborator Author

jlubo commented Sep 11, 2024

Yes, sure. I'll check #2226 again in the next days.

@jlubo jlubo closed this Oct 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants